﻿package com.jfdesgagne.jfdesgagne09.core.service {
	import flash.net.NetConnection;
	import flash.net.ObjectEncoding;
	import flash.events.NetStatusEvent;

/***************************************************
	Class RemotingService AS3
----------------------------------------------------
	This file set encoding and start connection
	between Flash and AMFPHP.
----------------------------------------------------
	History of file
----------------------------------------------------
	2007-07-19 --> File created 
***************************************************/ 
public class RemotingService extends NetConnection {
/*
	About: Description
	This file set encoding and start connection
	between Flash and AMFPHP.
	
	About: Author		
	Jean-François Desgagné jfdesgagne[-at-]gmail.com
	
	About: License		
	Creative Commons http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode
	
	About: File Created    
	July 19th 2007
	
	About: Last modifications	
	July 19th 2007
*/
/***************************************************
	Constructor 
***************************************************/
	/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
		Constructor: 	RemotingService
						Assign arguments to class properties
						
		Parameters:		
						_url 	  - Url of AMFPHP gateway.
						_encoding - AMF encodage string.
	'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
	public function RemotingService(_url:String, _encoding:Number = ObjectEncoding.AMF0){
		this.objectEncoding = _encoding;
		this.connect(_url);
		this.addEventListener(NetStatusEvent.NET_STATUS, this._netStatus);
	}
	
	private function _netStatus(_event:NetStatusEvent):void {
		for(var element:String in _event.info) {
			trace(element+":"+_event.info[element]);
		}

	}
}
}